﻿<div class="modal-body">
    <div class="modal-header">
        <h3 class="modal-title">Списък с решения</h3>
    </div>
    <div class="modal-body">
        <table class="table table-hover">
            <thead>
            <tr>
                <td>#</td>
                <td>Успешно решение</td>
                <td>Проверено</td>
            </tr>
            </thead>
            <tbody>
                <tr ng-repeat="submission in vm.submissions" ng-click="vm.viewSubmissionDetails(submission.id)" ng-class="vm.activeSubmissionId == submission.id ? 'submission-row success' : 'submission-row active'">
                    <td>
                        {{ submission.id }}
                    </td>
                    <td>{{ submission.isSuccessful ? 'Да' : 'Не' }}</td>
                    <td>{{ submission.isProcessed ? 'Да' : 'Не' }}</td>
                </tr>
            </tbody>
        </table>
    </div>
    <div uib-collapse="vm.submissionDetails == null">
        <h3>Компилация</h3>
        <hr>
        <div class="form-group">
            <div>
                <label for="successfulCompilation">Успешна компилация:</label>
                <textarea class="form-control"
                          rows="1"
                          id="successfulCompilation"
                          disabled>{{vm.submissionDetails.compilationSuccessful ? 'Да' : 'Не'}}</textarea>
            </div>
        </div>
        <div class="form-group">
            <div>
                <label for="sourceCode">Сорс Код:</label>
                <textarea class="form-control"
                          rows="10"
                          id="sourceCode"
                          ng-model="vm.submissionDetails.sourceCode"
                          disabled></textarea>
            </div>
        </div>
        <div class="form-group">
            <div>
                <label for="compilationOutput">Изход от компилация:</label>
                <textarea class="form-control"
                          rows="5"
                          id="compilationOutput"
                          disabled
                          ng-model="vm.submissionDetails.compilationOutput"></textarea>
            </div>
        </div>
        <div ng-repeat="testRun in vm.submissionDetails.executedTestRuns">
            <fieldset>
                <legend>Изпълнение на тест номер {{$index}} </legend>
                <div class="form-group">
                    <div>
                        <label for="successfulTestRun">Успешен тест:</label>
                        <textarea class="form-control"
                                  rows="1"
                                  id="successfulTestRun"
                                  disabled>{{testRun.testRunSuccessful ? 'Да' : 'Не'}}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div>
                        <label for="input">Тестов вход:</label>
                        <textarea class="form-control"
                                  rows="4"
                                  id="input"
                                  ng-model="testRun.input"
                                  disabled></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div>
                        <label for="expectedOutput">Очакван изход:</label>
                        <textarea class="form-control"
                                  rows="4"
                                  id="expectedOutput"
                                  ng-model="testRun.expectedOutput"
                                  disabled></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div>
                        <label for="actualOutput">Получен изход:</label>
                        <textarea class="form-control"
                                  rows="4"
                                  id="actualOutput"
                                  ng-model="testRun.actualOutput"
                                  disabled></textarea>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-warning" type="button" ng-click="vm.cancel()">Откажи</button>
    </div>
</div>
